/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upf.Ilusio.messaging;

import edu.upf.Ilusio.Entities.Picture;
import edu.upf.Ilusio.Interfaces.Listener;
import java.lang.String;
import java.util.Date;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;

/**
 *
 * @author xday666
 */
public class SearchProfileListener implements Listener {

    IM im, im2;

    public SearchProfileListener(IM instancem){
        im=instancem;
    }



    public void processPacket(Packet packet){
        if (packet instanceof Message) {
            Message msg = (Message) packet;
            

            Picture searchPic= (Picture) msg.getProperty("searchPic");
            
            im.addText(msg.getFrom(),"VALORES DE searchPic RECIBIDO:");
            im.addText(msg.getFrom(),"AUTHOR: " + searchPic.getAuthor(0));
            im.addText(msg.getFrom(),"KEYWORD: " + searchPic.getKeyword(0));
            im.addText(msg.getFrom(),"TAG: " + searchPic.getTag(0));
            im.addText(msg.getFrom(),"LATITUDE: " + searchPic.getLatitude());
            im.addText(msg.getFrom(),"LONGITUDE: " + searchPic.getLongitude());

        }
    }
}
